#include "type.h"
#include "message.h"
#include "protect.h"
void init_descriptor(struct descriptor* des,u32 base,u32 limit,u8 attr,u8 attr1){
	des->limit_low=limit&0xFFFF;
	des->base_low=base&0xFFFF;
	des->base_mid=(base>>16)&0xFF;
	des->attribute=attr;
	des->limit_high=(limit>>16)&0xF;
	des->attribute1=attr1&0xF;
	des->base_high=(base>>24)&0xFF;
}
u32 seg2phys(struct descriptor* des){
	return des->base_low|des->base_mid<<16|des->base_high<<24;
}
